\doxysection{x\+Task\+Notify }
\hypertarget{group__x_task_notify}{}\label{group__x_task_notify}\index{xTaskNotify@{xTaskNotify}}
task. h 
\begin{DoxyPre}BaseType\_t xTaskNotify( TaskHandle\_t xTaskToNotify, uint32\_t ulValue, eNotifyAction eAction );\end{DoxyPre}


config\+USE\+\_\+\+TASK\+\_\+\+NOTIFICATIONS must be undefined or defined as 1 for this function to be available.

When config\+USE\+\_\+\+TASK\+\_\+\+NOTIFICATIONS is set to one each task has its own private "{}notification value"{}, which is a 32-\/bit unsigned integer (uint32\+\_\+t).

Events can be sent to a task using an intermediary object. Examples of such objects are queues, semaphores, mutexes and event groups. Task notifications are a method of sending an event directly to a task without the need for such an intermediary object.

A notification sent to a task can optionally perform an action, such as update, overwrite or increment the task\textquotesingle{}s notification value. In that way task notifications can be used to send data to a task, or be used as light weight and fast binary or counting semaphores.

A notification sent to a task will remain pending until it is cleared by the task calling x\+Task\+Notify\+Wait() or ul\+Task\+Notify\+Take(). If the task was already in the Blocked state to wait for a notification when the notification arrives then the task will automatically be removed from the Blocked state (unblocked) and the notification cleared.

A task can use x\+Task\+Notify\+Wait() to \mbox{[}optionally\mbox{]} block to wait for a notification to be pending, or ul\+Task\+Notify\+Take() to \mbox{[}optionally\mbox{]} block to wait for its notification value to have a non-\/zero value. The task does not consume any CPU time while it is in the Blocked state.

See \href{http://www.FreeRTOS.org/RTOS-task-notifications.html}{\texttt{http\+://www.\+Free\+RTOS.\+org/\+RTOS-\/task-\/notifications.\+html}} for details.


\begin{DoxyParams}{Parameters}
{\em x\+Task\+To\+Notify} & The handle of the task being notified. The handle to a task can be returned from the x\+Task\+Create() API function used to create the task, and the handle of the currently running task can be obtained by calling x\+Task\+Get\+Current\+Task\+Handle().\\
\hline
{\em ul\+Value} & Data that can be sent with the notification. How the data is used depends on the value of the e\+Action parameter.\\
\hline
{\em e\+Action} & Specifies how the notification updates the task\textquotesingle{}s notification value, if at all. Valid values for e\+Action are as follows\+:\\
\hline
\end{DoxyParams}
e\+Set\+Bits -\/ The task\textquotesingle{}s notification value is bitwise ORed with ul\+Value. x\+Task\+Nofify() always returns pd\+PASS in this case.

e\+Increment -\/ The task\textquotesingle{}s notification value is incremented. ul\+Value is not used and x\+Task\+Notify() always returns pd\+PASS in this case.

e\+Set\+Value\+With\+Overwrite -\/ The task\textquotesingle{}s notification value is set to the value of ul\+Value, even if the task being notified had not yet processed the previous notification (the task already had a notification pending). x\+Task\+Notify() always returns pd\+PASS in this case.

e\+Set\+Value\+Without\+Overwrite -\/ If the task being notified did not already have a notification pending then the task\textquotesingle{}s notification value is set to ul\+Value and x\+Task\+Notify() will return pd\+PASS. If the task being notified already had a notification pending then no action is performed and pd\+FAIL is returned.

e\+No\+Action -\/ The task receives a notification without its notification value being updated. ul\+Value is not used and x\+Task\+Notify() always returns pd\+PASS in this case.

pul\+Previous\+Notification\+Value -\/ Can be used to pass out the subject task\textquotesingle{}s notification value before any bits are modified by the notify function.

\begin{DoxyReturn}{Returns}
Dependent on the value of e\+Action. See the description of the e\+Action parameter.
\end{DoxyReturn}
task. h 
\begin{DoxyPre}BaseType\_t xTaskNotifyFromISR( TaskHandle\_t xTaskToNotify, uint32\_t ulValue, eNotifyAction eAction, BaseType\_t *pxHigherPriorityTaskWoken );\end{DoxyPre}


config\+USE\+\_\+\+TASK\+\_\+\+NOTIFICATIONS must be undefined or defined as 1 for this function to be available.

When config\+USE\+\_\+\+TASK\+\_\+\+NOTIFICATIONS is set to one each task has its own private "{}notification value"{}, which is a 32-\/bit unsigned integer (uint32\+\_\+t).

A version of x\+Task\+Notify() that can be used from an interrupt service routine (ISR).

Events can be sent to a task using an intermediary object. Examples of such objects are queues, semaphores, mutexes and event groups. Task notifications are a method of sending an event directly to a task without the need for such an intermediary object.

A notification sent to a task can optionally perform an action, such as update, overwrite or increment the task\textquotesingle{}s notification value. In that way task notifications can be used to send data to a task, or be used as light weight and fast binary or counting semaphores.

A notification sent to a task will remain pending until it is cleared by the task calling x\+Task\+Notify\+Wait() or ul\+Task\+Notify\+Take(). If the task was already in the Blocked state to wait for a notification when the notification arrives then the task will automatically be removed from the Blocked state (unblocked) and the notification cleared.

A task can use x\+Task\+Notify\+Wait() to \mbox{[}optionally\mbox{]} block to wait for a notification to be pending, or ul\+Task\+Notify\+Take() to \mbox{[}optionally\mbox{]} block to wait for its notification value to have a non-\/zero value. The task does not consume any CPU time while it is in the Blocked state.

See \href{http://www.FreeRTOS.org/RTOS-task-notifications.html}{\texttt{http\+://www.\+Free\+RTOS.\+org/\+RTOS-\/task-\/notifications.\+html}} for details.


\begin{DoxyParams}{Parameters}
{\em x\+Task\+To\+Notify} & The handle of the task being notified. The handle to a task can be returned from the x\+Task\+Create() API function used to create the task, and the handle of the currently running task can be obtained by calling x\+Task\+Get\+Current\+Task\+Handle().\\
\hline
{\em ul\+Value} & Data that can be sent with the notification. How the data is used depends on the value of the e\+Action parameter.\\
\hline
{\em e\+Action} & Specifies how the notification updates the task\textquotesingle{}s notification value, if at all. Valid values for e\+Action are as follows\+:\\
\hline
\end{DoxyParams}
e\+Set\+Bits -\/ The task\textquotesingle{}s notification value is bitwise ORed with ul\+Value. x\+Task\+Nofify() always returns pd\+PASS in this case.

e\+Increment -\/ The task\textquotesingle{}s notification value is incremented. ul\+Value is not used and x\+Task\+Notify() always returns pd\+PASS in this case.

e\+Set\+Value\+With\+Overwrite -\/ The task\textquotesingle{}s notification value is set to the value of ul\+Value, even if the task being notified had not yet processed the previous notification (the task already had a notification pending). x\+Task\+Notify() always returns pd\+PASS in this case.

e\+Set\+Value\+Without\+Overwrite -\/ If the task being notified did not already have a notification pending then the task\textquotesingle{}s notification value is set to ul\+Value and x\+Task\+Notify() will return pd\+PASS. If the task being notified already had a notification pending then no action is performed and pd\+FAIL is returned.

e\+No\+Action -\/ The task receives a notification without its notification value being updated. ul\+Value is not used and x\+Task\+Notify() always returns pd\+PASS in this case.


\begin{DoxyParams}{Parameters}
{\em px\+Higher\+Priority\+Task\+Woken} & x\+Task\+Notify\+From\+ISR() will set \texorpdfstring{$\ast$}{*}px\+Higher\+Priority\+Task\+Woken to pd\+TRUE if sending the notification caused the task to which the notification was sent to leave the Blocked state, and the unblocked task has a priority higher than the currently running task. If x\+Task\+Notify\+From\+ISR() sets this value to pd\+TRUE then a context switch should be requested before the interrupt is exited. How a context switch is requested from an ISR is dependent on the port -\/ see the documentation page for the port in use.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Dependent on the value of e\+Action. See the description of the e\+Action parameter. 
\end{DoxyReturn}
